Using Quarto (R) For Creating Interactive Presentations

Echarts4r is used for interactive plots

Oliver Zingg

Table Of Contents

  • How to navigate this presentation
  • First Plot
  • Findings
  • Validity of Clusters
  • Potential Implications for Yapeal

How to Navigate This Presentation

How to Navigate This Presentation

  • Click on the presentation to active the window and press F for full screen
  • With ESC full screen is exited.
  • Use arrow keys or space to go back and forth

First Plot

Code First Plot

Load Packages

library(palmerpenguins)
library(RColorBrewer)

penguins <- palmerpenguins::penguins

my_colors <- brewer.pal(3, "Dark2")

penguins |>
  group_by(species) |>
  e_charts(bill_length_mm) |>
  e_scatter(flipper_length_mm, symbol_size = 7) |>
  e_title('Comparing Three different Penguins Species', 
          subtext = 'Flipper Length (mm) vs Bill Length (mm)') |>
  e_legend(
    orient = 'vertical',
    right = '5%',
    top = '40%') |>
  e_y_axis(min = 160, max = 250) |>
  e_x_axis(min = 30) |>
  e_color(my_colors) |>
  e_grid(right = '15%') |>
  e_tooltip(trigger = "axis") |>
  e_toolbox_feature('saveAsImage') |>
  e_toolbox_feature('dataView')

Load Data

library(palmerpenguins)
library(RColorBrewer)

penguins <- palmerpenguins::penguins

my_colors <- brewer.pal(3, "Dark2")

penguins |>
  group_by(species) |>
  e_charts(bill_length_mm) |>
  e_scatter(flipper_length_mm, symbol_size = 7) |>
  e_title('Comparing Three different Penguins Species', 
          subtext = 'Flipper Length (mm) vs Bill Length (mm)') |>
  e_legend(
    orient = 'vertical',
    right = '5%',
    top = '40%') |>
  e_y_axis(min = 160, max = 250) |>
  e_x_axis(min = 30) |>
  e_color(my_colors) |>
  e_grid(right = '15%') |>
  e_tooltip(trigger = "axis") |>
  e_toolbox_feature('saveAsImage') |>
  e_toolbox_feature('dataView')

Load Colors

library(palmerpenguins)
library(RColorBrewer)

penguins <- palmerpenguins::penguins

my_colors <- brewer.pal(3, "Dark2")

penguins |>
  group_by(species) |>
  e_charts(bill_length_mm) |>
  e_scatter(flipper_length_mm, symbol_size = 7) |>
  e_title('Comparing Three different Penguins Species', 
          subtext = 'Flipper Length (mm) vs Bill Length (mm)') |>
  e_legend(
    orient = 'vertical',
    right = '5%',
    top = '40%') |>
  e_y_axis(min = 160, max = 250) |>
  e_x_axis(min = 30) |>
  e_color(my_colors) |>
  e_grid(right = '15%') |>
  e_tooltip(trigger = "axis") |>
  e_toolbox_feature('saveAsImage') |>
  e_toolbox_feature('dataView')

Creat Interactive Plot

library(palmerpenguins)
library(RColorBrewer)

penguins <- palmerpenguins::penguins

my_colors <- brewer.pal(3, "Dark2")

penguins |>
  group_by(species) |>
  e_charts(bill_length_mm) |>
  e_scatter(flipper_length_mm, symbol_size = 7) |>
  e_title('Comparing Three different Penguins Species', 
          subtext = 'Flipper Length (mm) vs Bill Length (mm)') |>
  e_legend(
    orient = 'vertical',
    right = '5%',
    top = '40%') |>
  e_y_axis(min = 160, max = 250) |>
  e_x_axis(min = 30) |>
  e_color(my_colors) |>
  e_grid(right = '15%') |>
  e_tooltip(trigger = "axis") |>
  e_toolbox_feature('saveAsImage') |>
  e_toolbox_feature('dataView')